<template>
<!--  审核结果-->
  <div>
    <div style="width: 60%;" class="padding15 marginAuto">
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
        <el-divider>基本信息</el-divider>
        <el-form-item label="标题" prop="status">
          标题
        </el-form-item>
        <el-form-item label="所属分类" prop="status">
          娱乐
        </el-form-item>
        <el-form-item label="发表人" prop="status">
          李强
        </el-form-item>
        <el-form-item label="发表时间" prop="status">
          2022-04-26
        </el-form-item>
        <el-form-item label="内容" prop="status">
          xxxxxxxxxxxxxxxxhahahahahhahah
        </el-form-item>
        <!-- 评论列表 -->
        <div v-if="queryPrams.type=='comment'">
          <el-divider>评论列表</el-divider>
          <el-table
                  :data="lists"
                  stripe
                  border
                  style="width: 100%">
                  <el-table-column align="center" type="index" label="序号" width="50" />
            <el-table-column  align="center" prop="organizationName" label="评价内容" min-width="160"/>
    
            <el-table-column  align="center" prop="endTime" label="评价人" width="100" />
      
            <el-table-column  align="center" prop="endTime" label="评价时间" width="120" />
            <el-table-column label="操作" align="center" min-width="120" fixed="right">
              <template slot-scope="scope">
                  <el-button size="mini"  type="primary"@click="look(scope.row)">查看</el-button>
              
              </template>
            </el-table-column>
          </el-table>
          <Pagination :total="total" :pages="pages" :searchQuery="searchQuery"></Pagination>
        </div>
        <!-- 审核意见 -->
         <div v-if="queryPrams.type=='examine'">
          <el-divider>审核意见</el-divider>
          <el-form-item label="审核结果" prop="status">
            <el-select style="width: 100%;" v-model="ruleForm.status" placeholder="请选择">
              <el-option
                v-for="(item,index) in options"
                :key="index"
                :label="item.name"
                :value="item.id">
              </el-option>
            </el-select>
          </el-form-item>
         
          <el-form-item label="审核意见" prop="remark">
            <el-input :disabled="disabled"   type="textarea"
            :rows="2" style="width: 100%;" v-model="ruleForm.remark" placeholder="审核意见"></el-input>
          </el-form-item>
  
        
         </div>
         <div class="marginT20"></div>
         <el-form-item>
          <el-button  v-if="queryPrams.type=='examine'" type="primary" :loading="isLoading" :submitDisbled="submitDisbled" @click="submitForm('ruleForm')">确定</el-button>
          <el-button @click="goback">返回</el-button>
        </el-form-item>
      </el-form>
    </div>
    <el-drawer
          append-to-body
          title="评论详情"
          :visible.sync="explainShow"
          size="80%"
          @close="close"
      >
      <CommentDetail :detailObj="detailObj" v-if="explainShow" @close="close" />
      </el-drawer>
  </div>
</template>
<script>
//  import {} from '@/assets/api/api'
import {AddEditmixin} from '@/assets/mixins/addEditmixin'


  export default {
    name:'ReviewComments',
    mixins: [AddEditmixin],
    components:{
      CommentDetail:()=>import('./components/commentDetail')
    },
    data(){
      return{
        explainShow:false,//查看评论显示
        pages:{ //分页搜索
          keyWord:'',
          page:1,
          size:10,
        },
        queryPrams:this.$route.query,
        total:0,// 总条数
        loading:false,//加载中...
        options:[{name:'通过',id:1},{name:'拒绝',id:2}],
        goBackPath:'/topicOfConversation/topicOfConversationList',//返回的路径
          isLoading:false,
        page:this.$route.query.page?this.$route.query.page:1,
        submitDisbled:false,
          infoName:'',//编辑取得名字查重要
        msg1:'新增账号',
          roleName:'',//角色名称
        ruleForm:{
          status:1,
          remark:'',
        
        },
        lists:[1],
        disabled:false,
        rules: {
        
        },
        detailObj:{

        }
      }
    },
    created() {
     
        
      },
    methods:{
      look(v){//查看详情
         this.detailObj =v;
         this.explainShow = true;
      },
      searchQuery(){//列表初始化

      },
      close(){
         this.explainShow = false
      },
     
      submitForm(formName) {
        let that = this;
        that.isLoading = true;
      
        this.$refs[formName].validate((valid) => {
          if (valid) {
             that.$emit('submit');
            that.isLoading = false;
          } else {
            that.isLoading = false;
            return false;
          }
        });
      },
    }
  }
</script>
<style lang="scss" scoped>

</style>
